<?php

include '../../db.php';
$connect = pg_connect($connectionString);
if (!$connect) {
    echo "connect : A connection to the server could not be established!";
    return false;
}

$params = array();
array_push($params, pg_escape_string($_POST["id"]));
$stmt = pg_prepare($connect, "delete_sale_header", "DELETE FROM sale_header WHERE id = $1;");
$result = pg_execute($connect, "delete_sale_header", $params);


if (!$result) {

    die("Error in SQL query: " . pg_last_error());
}

echo "Data successfully inserted!";

pg_free_result($result);
pg_close($connect);


